<?php if(!defined('WANYA_ROOT')) {exit('error!');}?>
<div class=containertitle><b>用户-活动管理</b>
<?php if(isset($_GET['active_del'])):?><span class="actived">删除成功</span><?php endif;?>
	<?php if(isset($_GET['active_update2'])):?><span class="actived">已设为处理。</span><?php endif;?>
	<?php if(isset($_GET['active_update1'])):?><span class="actived">已设为待处理。</span><?php endif;?>
</div>
<div class=line></div>

<form action="activity_user_list.php" method="post" name="user_activity" id="user_activity">
	<fieldset style="border:2px solid #0099ff;">
		<legend>检索条件</legend>
		<table style="margin-bottom: 5px;margin-left: 10px">
		<tr>
			<td>用户：</td>
			<td>
				<input type="text" readonly="readonly" name="user_name" id="user_name" value="<?php echo $user_name;?>">　
				<input type="button" value="选择" onclick="openSelectWin('user','wx_openid','user_name');" class="button">
				<input type="hidden" name="wx_openid" id="wx_openid" value="<?php echo $wx_openid;?>">
			</td>
			<td width="20px"></td>
			<td>活动：</td>
			<td>
				<input type="text" readonly="readonly" name="activity_name" id="activity_name" value="<?php echo $activity_name;?>">　
				<input type="button" value="选择"  onclick="openSelectWin('activity','activity_id','activity_name');" class="button">
				<input type="hidden" name="card_id" id="activity_id" value="<?php echo $activity_id;?>">
			</td><td width="20px"></td>

			<td>是否处理：</td>
			<td>
				<select name="handled" >
					<option value ="9" <?php echo($handled==9||!$handled)?'selected':'';?>></option>
					<option value ="1" <?php echo($handled==1)?'selected':'';?>>待处理</option>
					<option value ="2" <?php echo($handled==2)?'selected':'';?>>已处理</option>
				</select>
			</td>
			<td width="20px"></td>
			<td>
				<input type="button" value="检索" class="button" onclick="commitSelect();">
			</td>


		</tr>
	</table>
	</fieldset>
	<br>
  <table width="100%" id="adm_comment_list" class="item_list">
  	<thead>
      <tr>
	<th width="50" colspan="1"><b>选择</b></th>
        <th width="100" colspan="1"><b>用户</b></th>
		  <th width="200" colspan="1"><b>电话</b></th>
		<th width="150"><b>活动</b></th>
		  <th width="150"><b>报名时间</b></th>
		  <th width="100"><b>状态</b></th>

        <th width="150"><b>操作</b></th>
      </tr>
    </thead>
    <tbody>
	<?php
	if($uas):
	foreach($uas as $key=>$value):
	?>
     <tr>
		<td><input type="checkbox" value="<?php echo $value['ID']; ?>" name="ids[]" class="ids" /></td>
		<td><?php echo $value['user_name']; ?></td>
		<td><?php echo $value['user_tel']; ?></td>
 		<td><?php echo $value['activity_name']; ?></td>
		<td><?php echo $value['buildtime']; ?></td>
		<td><?php echo $value['handled']==1?"待处理":"已处理"; ?></td>
 		<td><input type="button" value="<?php echo $value['handled']==1?"已处理":"待处理"; ?>"  onclick="commitUpdate('<?php echo $value['ID']; ?>',<?php echo $value['handled']==1?"2":"1"; ?>);"></td>
	<?php endforeach;else:?>
	  <tr><td class="tdcenter" colspan="6">还没有用户活动信息</td></tr>
	<?php endif;?>
	</tbody>
  </table>
	<div class="list_footer">
	<a href="javascript:void(0);" id="select_all">全选</a> 选中项：
    <a href="javascript:commitDel();" class="care">删除</a>
	<input name="action" id="action" value="" type="hidden" />
	<input name="ID" id="ID" value="" type="hidden" />
	<input name="state" id="state" value="" type="hidden" />
		<input name="pid" id="pid" value="<?php echo $page; ?>" type="hidden" />
	</div>
    <div class="page"><?php echo $pageurl; ?> (共有<?php echo $uasNum; ?>个用户-活动信息)</div>
</form>
<script>
$(document).ready(function(){
	$("#select_all").toggle(function () {$(".ids").attr("checked", "checked");},function () {$(".ids").removeAttr("checked");});
	$("#adm_comment_list tbody tr:odd").addClass("tralt_b");
	$("#adm_comment_list tbody tr")
		.mouseover(function(){$(this).addClass("trover");$(this).find("span").show();})
		.mouseout(function(){$(this).removeClass("trover");$(this).find("span").hide();})
});
setTimeout(hideActived,2600);
function commitDel(){
	if (getChecked('ids') == false) {
		alert('请选择要删除的用户的活动信息');
		return;
	}
	if(!confirm('你确定要删除所选用户的活动信息吗？')){return;}
	$("#action").val("delete");
	$("#user_activity").submit();
}
function commitSelect(){
	$("#pid").val("1");
	$("#user_activity").submit();
}
function commitUpdate(id,stste){
	$("#ID").val(id);
	$("#state").val(stste);
	$("#action").val("update");
	$("#user_activity").submit();
}
$("#menu_cm").addClass('sidebarsubmenu1');
</script>